#ifndef CURVABEZIER_H
#define CURVABEZIER_H

#include "curva.h"

class CurvaBezier : public Curva
{
	protected:
		void plotSubCurve(QGraphicsScene &s, QPen& p, int index);

		void plotCurve(QGraphicsScene &s, QPen& p);
		void plotControls(QGraphicsScene &s, QPen& p);
		void plotSteps(QGraphicsScene &s, QPen& p);
		void plotFecho(QGraphicsScene &s, QPen& p);

	public:
		//CurvaBezier(QGraphicsScene& s);
		CurvaBezier (void);
		~CurvaBezier ();

		void read(QDomElement node);
		QDomElement save(QDomDocument doc);

		void addPoint (QPointF p);
		int removePoint (QPointF* p);

		void clear (QGraphicsScene &s);
		void plot(QGraphicsScene &s, QPen& p, RenderMode renderMode);
		bool validate();
		bool minimumValidate();

		QImage draw();

		QPointF* selectPoint (QPointF& p, const double precision);
};


#endif // CURVABEZIER_H
